#ifndef REGISTER_H
#define REGISTER_H


#include <QQmlApplicationEngine>
#include <QQmlContext>

#include <QCloseEvent>
#include <QResource>
#include "tailor.h"
#include<mainwindow.h>
#include <QDialog>
#include"global.h"

namespace Ui {
class Register;
}

class Register : public QDialog
{
    Q_OBJECT

public:
    explicit Register(QWidget *parent = nullptr);
    ~Register();

    bool NoSign_in();

private:
    bool findFiles();
    void initReq();

private slots:
    void on_pushButton_2_clicked();
    void on_pushButton_clicked();
    void user_registration(const QByteArray &ba);
    void gggg();

signals:
    void guan();

private:
    Ui::Register *ui;
    std::map<ReqID, std::function<void(QByteArray, ErrorCodes)>> req;

    QString url = "http://116.198.241.238:8080";
    QString myName = "ppch";

    QQmlApplicationEngine *engine = nullptr;
    Tailor *tailor = nullptr;
};

#endif // REGISTER_H
